package com.thirteen.app.service;

import com.thirteen.app.dto.CreateExamRequest.ExamDto;
import com.thirteen.app.dto.ExamConditionDto;
import com.thirteen.app.dto.ExamResponse.ExamListStudentDto;
import com.thirteen.app.dto.ExamResponse.ExamListTeacherDto;
import com.thirteen.app.dto.ExamResponse.SelectExamByUserDto;
import com.thirteen.app.dto.PaperList;
import com.thirteen.app.dto.PaperRespose.PaperDto;
import com.thirteen.app.entity.Exam;

import java.util.List;
import java.util.Map;

public interface ExamService {

    //    开始考试
    Integer startExam(Integer examId, Integer userId);

    //    创建考试
    Boolean insertExam(ExamDto examDto);

    //    学生端查询考试
    List<ExamListStudentDto> queryAllExamStudent(ExamConditionDto examConditionDto);

    //    学生端查询考试
    List<ExamListTeacherDto> queryAllExamTeacher(ExamConditionDto examConditionDto);


    //        zql&ar
    PaperList getExamPaperList(Integer examId);

    //wc

    /**
     * 通过ID查询单条数据
     */
    Exam queryById(Integer examid);

    /**
     * 查询多条数据
     */
    Map<String, Object> queryAllByLimit(int offset, int limit);


    /**
     * 修改数据
     */
    boolean update(Exam exam);

    /**
     * 通过主键删除数据
     */
    boolean deleteById(Integer examid);

    int getExamCount();

    Map<String, Object> queryAllByTime(String beginTime, String endTime, String examName, Integer userId);

    List<SelectExamByUserDto> queryAllByUser(ExamConditionDto examConditionDto);

    String getType(Object o);


    //PaperDto paperConstituteRandom(Integer examId, Integer userId);

    boolean insertAnswerSet(PaperDto paperDTO, Integer examRecordId);


    Map<String, Object> queryAllByTeacherTime(String beginTime, String endTime, String examName, Integer userId);


    Map<String, Object> queryExamByName(String examName, Integer userId);

    boolean queryExamState(Integer examId, Integer userId);

    PaperDto getPaper(Integer examId, Integer examRecordId, Integer userId);

}
